package com.yeban.javase.day01;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/9
 */

// 创建学生类
public class Student {

    public String name;
    public int age;
    public int stuNumber;

    public Student() {
        System.out.println("无参构造函数");
    }


    public void study(Student s) {
        System.out.println(s.name + "正在学习...");
    }

    public int selectStuNumber(Student s) {

        System.out.println("selectStuNumber()方法中：" + s.name + "的学号为：" + s.stuNumber);
        return s.stuNumber;
    }

    public static void main(String[] args) {

        Student stu = new Student();

        // 对象调用属性，进行赋值
        stu.name = "张三";
        stu.age = 18;
        stu.stuNumber = 2022001;

        // 对象调用方法，
        stu.study(stu);
        System.out.println("mian()方法中：" + stu.name + "的学号为：" + stu.selectStuNumber(stu));

    }
}
